package com.kaifa.org.tp01.example02;

import com.kaifa.org.tp01.example02.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test02 {
    public static void main(String[] args) {
//        引入配置文件
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");

        UserService userService = (UserService)applicationContext.getBean("userService");

        boolean bl=userService.say();
        if(bl){
            System.out.println("注入了");
        }else{
            System.out.println("注入返回了我想要的结果");
        }
    }
}
